#pragma once
# include "Hash.h"

namespace xx
{

	template<class K>
	class unordered_set
	{
		struct unsetRekey
		{
			K operator()(K key)
			{
				return key;
			}
		};
	public:
		typename typedef HashTable<K, K, unsetRekey>::Iterator iterator;
		typename typedef HashTable<K, K, unsetRekey>::const_Iterator const_iterator;
		iterator begin()
		{
			return _ht.Begin();
		}
		const_iterator begin() const
		{
			return _ht.Begin();
		}
		iterator end()
		{
			return _ht.End();
		}
		const_iterator end() const
		{
			return _ht.End();
		}

		bool insert(K& key)
		{
			return _ht.insert(key);
		}
		

	private:
		HashTable<K, K, unsetRekey> _ht;
	};
	
	void print(const unordered_set<int>& s)
	{
		for (auto e :s )
		{
			cout << e << " ";
		}
		cout << endl;
	}
}
